//
//  GHY_CameraSetView.m
//  Camera
//
//  Created by aaaaaa on 16/8/13.
//  Copyright © 2016年 葛海一. All rights reserved.
//

#import "GHY_CameraSetView.h"

@interface GHY_CameraSetView ()

@property (nonatomic, retain) UIImageView *imageView;
@property (nonatomic, retain) UILabel *titleLable;

@end

@implementation GHY_CameraSetView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
}

- (void)createSubViews{
    
    self.status = 0;
    
    self.imageView = [[UIImageView alloc] init];
    [self addSubview:_imageView];
    
    [self.imageView mas_remakeConstraints:^(MASConstraintMaker *make) {
       
        make.centerX.equalTo(self.mas_centerX);
        make.top.equalTo(self.mas_top).mas_equalTo(HEIGHT_VIEW * 0.1);
        make.height.mas_equalTo(HEIGHT_VIEW * 0.5);
        make.width.mas_equalTo(HEIGHT_VIEW * 0.5 );
        
    }];
    
    self.titleLable = [[UILabel alloc] init];
    [self addSubview:_titleLable];
    
    [self.titleLable mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.mas_centerX);
        make.top.equalTo(self.imageView.mas_bottom).offset(HEIGHT_VIEW * 0.1);
        make.width.mas_equalTo(WIDTH_VIEW * 0.8);
        make.height.mas_equalTo(HEIGHT_VIEW * 0.15);
    }];
    
    self.titleLable.textAlignment = NSTextAlignmentCenter;
    self.titleLable.font = [UIFont systemFontOfSize:12];
    self.titleLable.textColor = [UIColor whiteColor];
    
}

- (void)setImageStr:(NSString *)imageStr{
    _imageStr  = imageStr;
    self.imageView.image = [UIImage imageNamed:imageStr];
}

- (void)setTitleStr:(NSString *)titleStr{
    _titleStr = titleStr;
    self.titleLable.text = titleStr;
}

- (void)setTextColor:(UIColor *)textColor {
    _textColor = textColor;
    self.titleLable.textColor = textColor;
}













@end
